package com.example.produces.service.impl;

import com.example.produces.entity.Client;
import com.example.produces.entity.Fstock;
import com.example.produces.mapper.FstockMapper;
import com.example.produces.service.FstockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
//对server接口里面的方法进行重写，并调用mapper接口
public class FstockImpl implements FstockService {
    @Autowired
    private FstockMapper fstockMapper;
    @Override
    public List<Fstock> findAll() {
        List<Fstock>fstocks=fstockMapper.findAll();
        return fstocks;
    }

    @Override
    public void add(Fstock fstock) {
          fstockMapper.add(fstock);
    }

    @Override
    public Fstock findOne(String designation) {
        return fstockMapper.findOne(designation);
    }

    @Override
    public void upDate(Fstock fstock) {
        fstockMapper.upDate(fstock);

    }

    @Override
    public void delete(String designation) {
        fstockMapper.delete(designation);
    }


}
